<template>
  <el-dialog width="1200px" :title="$t('m.sigin.sigin')" :visible.sync="popupVisible" :before-close="close">
    <!-- tool start -->
    <el-form align="left" ref="form" :model="detail" label-width="120px">
      <el-row>
        <el-col :span="8">
          <el-form-item :label="$t('m.notice.noticenumber')">
            <el-input disabled v-model="detail.noticenumber" autocomplete="off"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.ordernumber')">
            <el-input disabled v-model="detail.ordernumber" autocomplete="off"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.warehouse')">
            <el-input maxlength="20" show-word-limit v-model="detail.warehousename" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.consignor')">
            <el-input maxlength="20" show-word-limit v-model="detail.consignorname" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.suppliername')">
            <el-input maxlength="20" show-word-limit v-model="detail.suppliername" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.typename')">
            <el-input maxlength="20" show-word-limit v-model="detail.typename" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.deliverycompany')">
            <el-input maxlength="20" show-word-limit v-model="detail.deliverycompany" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.platenumber')">
            <el-input maxlength="20" show-word-limit v-model="detail.platenumber" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.deliveryman')">
            <el-input maxlength="20" show-word-limit v-model="detail.deliveryman" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('m.in.contact')">
            <el-input maxlength="20" show-word-limit v-model="detail.contact" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item :label="$t('m.remark')">
            <el-input type="textarea" maxlength="100" v-model="remark" :rows="2" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!-- tool end -->

    <!-- table start -->
    <el-row>
      <el-col :span="24">
        <el-table
          ref="table"
          :data="detail.signindetailList"
          stripe
          empty-text
          fit>
          <el-table-column align="center" type="index" :label="$t('m.index')" width="50"></el-table-column>
          <el-table-column align="center" prop="productspeccode" label="sku"></el-table-column>
          <el-table-column align="center" prop="suppliercode" label="supplierCode"></el-table-column>
          <el-table-column align="center" prop="productname" :label="$t('m.in.productname')"></el-table-column>
          <el-table-column align="center" prop="productspec" :label="$t('m.in.productspec')"></el-table-column>
          <el-table-column align="center" prop="plannedquantity" :label="$t('m.in.plannedquantity')"></el-table-column>
          <el-table-column align="center" prop="actualquantity" :label="$t('m.sigin.arrive')"></el-table-column>
          <el-table-column align="center" :label="$t('m.operation')">
            <template slot-scope="scope">
              <el-button
                type="primary"
                size="mini"
                @click="getData(detail,scope.$index)"
              >{{$t('m.sigin.result')}}</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
    <!-- table end -->
    <el-row>
      <el-col :span="24">
        <el-button @click="close">{{$t('m.close')}}</el-button>
      </el-col>
    </el-row>
  </el-dialog>
</template>
<script>
export default {
  name:'signing-popup',
  props:['popupVisible', 'detail'],
  data(){
    return {
      remark:''
    }
  },
  methods:{
    close(){
      this.$emit('close')
    },
    getData(options, index){
      this.$emit('getData', options.signindetailList[index].detailid)
    }
  }
}
</script>